home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / fax / src / rules < prev    next >
Text File  |  1994-08-01  |  6KB  |  185 lines

  1. #    $Header: /usr/people/sam/fax/RCS/rules,v 1.7 1994/02/28 13:23:58 sam Rel $
  2. #
  3. # FlexFAX Facsimile Software
  4. #
  5. # Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 Sam Leffler
  6. # Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
  7. # Permission to use, copy, modify, distribute, and sell this software and 
  8. # its documentation for any purpose is hereby granted without fee, provided
  9. # that (i) the above copyright notices and this permission notice appear in
  10. # all copies of the software and related documentation, and (ii) the names of
  11. # Sam Leffler and Silicon Graphics may not be used in any advertising or
  12. # publicity relating to the software without the specific, prior written
  13. # permission of Sam Leffler and Silicon Graphics.
  14. # THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
  15. # EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
  16. # WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
  17. # IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
  18. # ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
  19. # OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  20. # WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
  21. # LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
  22. # OF THIS SOFTWARE.
  23. #
  24. # Common makefile rules.
  25. #
  26. # - After including defs, a makefile should say
  27. #   ``include ${COMMONRULES}'' to get this file.
  28. # - It is up to the including makefile to define a default rule before
  29. #   including ${COMMONRULES}.
  30. # - This file defines the following lists: SOURCES, enumerating all
  31. #   source files; OBJECTS, the .o files derived from compilable source;
  32. #   and DIRT, which lists intermediates and temporary files to be
  33. #   removed by clean.
  34. # - The including (parent) makefile may define source file lists for each
  35. #   standard suffix: CFILES for .c, etc.  This file combines all such
  36. #   lists into SOURCES.
  37. # - The parent makefile must define TARGETS in order for clobber to work.
  38. #
  39. SOURCES= ${HFILES} ${C++FILES} ${CFILES} ${SHFILES}
  40. OBJECTS= ${C++FILES:.c++=.o} ${CFILES:.c=.o}
  41.  
  42. #
  43. # C++ inference rules.
  44. #
  45. .SUFFIXES: .c++ .yuk
  46.  
  47. .c++:
  48.     ${C++F} ${C++FILE} $< ${LDFLAGS} -o $@
  49. .c++.o:
  50.     ${C++F} ${C++FILE} -c $<
  51. .c++.s:
  52.     ${C++F} ${C++FILE} -S $<
  53. .c++.i:
  54.     ${C++F} ${C++FILE} -E $< > $*.i
  55. .c++.yuk:
  56.     ${C++F} ${C++FILE} -Fc -.yuk $<
  57.  
  58. #
  59. # Rather than removing ${OBJECTS}, clean removes ${CLEANOBJECTS} which we
  60. # set to *.[ou] by default, to remove obsolete objects and -O3 ucode files
  61. # after source has been reorganized.  If files ending in .[ou] should not
  62. # be removed by clean, this definition can be overridden after the include
  63. # of commonrules to define CLEANOBJECTS=${OBJECTS}.
  64. #
  65. CLEANOBJECTS= *.[ou]
  66.  
  67. #
  68. # What gets cleaned, apart from objects.
  69. #
  70. DIRT= ${GDIRT} ${VDIRT} ${LDIRT}
  71. GDIRT= a.out core ${_FORCE}
  72.  
  73. #
  74. # An always-unsatisfied target.
  75. #
  76. _FORCE= ${COMMONPREF}_force
  77. ${_FORCE}:
  78.  
  79. #
  80. # File removal rules: there are three.
  81. #    - clean removes intermediates and dirt
  82. #    - clobber removes targets as well as intermediates and dirt
  83. #    - rmtargets removes targets only
  84. # If you use incdepend (see below), then 'make clobber' will remove the
  85. # .*dependtime marker files used by incdepend to find modified ${DEPFILES}.
  86. #
  87. .PRECIOUS: .sdependtime .c++dependtime .cdependtime
  88.  
  89. ${COMMONPREF}clobber: ${COMMONPREF}clean ${COMMONPREF}rmtargets ${_FORCE}
  90.     -rm -rf ${MKDEPFILE} .*dependtime .*incdepend
  91. ${COMMONPREF}clean: ${_FORCE}
  92.     -rm -rf ${CLEANOBJECTS} ${DIRT}
  93. ${COMMONPREF}rmtargets: ${_FORCE}
  94.     -rm -rf ${TARGETS}
  95.  
  96. #
  97. # Automated header dependency inference.  Most makefiles need only set the
  98. # CFILES, etc. lists and include commonrules.
  99. #
  100. ${COMMONPREF}depend: ${_FORCE}
  101.     @Clist="${C++DEPFILES}" clist="${CDEPFILES}"; \
  102.     case "$$Clist" in \
  103.       *.*) \
  104.         ${ECHO} "${MKDEPENDC++} ${MKDEPFILE} $$Clist"; \
  105.         ${MKDEPENDC++} ${MKDEPFILE} $$Clist; \
  106.         touch .c++dependtime; \
  107.     esac; \
  108.     case "$$clist" in \
  109.       *.*) \
  110.         ${ECHO} "${MKDEPENDC} ${MKDEPFILE} $$clist"; \
  111.         ${MKDEPENDC} ${MKDEPFILE} $$clist; \
  112.         touch .cdependtime; \
  113.     esac
  114. _c++depend: ${C++DEPFILES} ${_FORCE}
  115.     ${C++F} -M ${C++DEPFILES} | ${RAWDEPFILTER}; \
  116.     touch .c++incdepend
  117. _cdepend: ${CDEPFILES} ${_FORCE}
  118.     ${CCF} -M ${CDEPFILES} | ${RAWDEPFILTER}; \
  119.     touch .cincdepend
  120.  
  121. #
  122. # Incremental depend uses marker files to find ${DEPFILES} that are newer
  123. # than their dependencies.  Note that the non-incremental rules, above, also
  124. # touch the marker files.
  125. #
  126. # XXX can't run only one sub-make that depends on all .*dependtime, because
  127. # XXX smake will parallelize and mkdepend doesn't interlock itself
  128. #
  129. ${COMMONPREF}incdepend: ${_FORCE}
  130.     @Clist="${C++DEPFILES}" clist="${CDEPFILES}"; \
  131.     case "$$Clist" in \
  132.       *.*) \
  133.         ${MAKE} -f ${MAKEFILE} _quiet.c++dependtime; \
  134.     esac; \
  135.     case "$$clist" in \
  136.       *.*) \
  137.         ${MAKE} -f ${MAKEFILE} _quiet.cdependtime; \
  138.     esac
  139.  
  140. # so that make doesn't announce "`.sdependtime' is up to date."
  141. _quiet.c++dependtime: .c++dependtime
  142. _quiet.cdependtime: .cdependtime
  143.  
  144. .c++dependtime: ${C++DEPFILES}
  145.     @if test -n "$?"; then \
  146.         ${ECHO} "${MKDEPENDC++} -i ${MKDEPFILE} $?"; \
  147.         ${MKDEPENDC++} -i ${MKDEPFILE} $?; \
  148.         touch $@; \
  149.     fi
  150. .cdependtime: ${CDEPFILES}
  151.     @if test -n "$?"; then \
  152.         ${ECHO} "${MKDEPENDC} -i ${MKDEPFILE} $?"; \
  153.         ${MKDEPENDC} -i ${MKDEPFILE} $?; \
  154.         touch $@; \
  155.     fi
  156.  
  157. # you can't add dependencies to a target that begins with '.'
  158. _c++incdepend: .c++incdepend
  159. _cincdepend: .cincdepend
  160.  
  161. .c++incdepend: ${C++DEPFILES}
  162.     @if test -n "$?"; then \
  163.         ${C++F} -M $? | ${RAWDEPFILTER}; \
  164.         touch $@; \
  165.     fi
  166. .cincdepend: ${CDEPFILES}
  167.     @if test -n "$?"; then \
  168.         ${CCF} -M $? | ${RAWDEPFILTER}; \
  169.         touch $@; \
  170.     fi
  171.  
  172. #
  173. # A sed filter that prepends ${VPATH} to object targets emitted by cc -M.
  174. # ${VPATH} should name a directory that holds product-dependent objects.
  175. #
  176. RAWDEPFILTER= sed -e 's:^:${VPATH}/:'
  177.  
  178. #
  179. # Include the make dependency file if it exists.
  180. #
  181. sinclude ${MKDEPFILE}
  182.